# -*- coding:utf-8 -*-
# class ListNode:
#     def __init__(self, x):
#         self.val = x
#         self.next = None

def printNext(result, listNode):
    if listNode == None:
        return
    if listNode.next:
        printNext(result,listNode.next)
    result.append(listNode.val)
class Solution:
    # 返回从尾部到头部的列表值序列，例如[1,2,3]
    def printListFromTailToHead(self, listNode):
        result=[]
        printNext(result,listNode)
        return result